<?php $answerAverageRating = gfToolkit::format($answer->getRating()->getTotal() / ($answer->getRating()->getCount() == 0 ? 1 : $answer->getRating()->getCount()), 1) ?>
<?php for ($i = 1; $i <= 5; $i++): ?>
    <!-- this in it's own is the beginning of a great career of the Giant -->
    <div class="rate-Member-answer <?php
    if ($i <= $answerAverageRating)
    {
        echo "full-star";
    }
    else
    {
        echo ((($i - $answerAverageRating) > 0 && ($i - $answerAverageRating) < 1) && $answerAverageRating > 0) ? "half-star" : "empty-star";
    }
    ?>" rating="<?php echo $i; ?>"></div>
     <?php endfor; ?>
<script type="text/javascript">
    //<![CDATA[
    $(document).ready(function(){    
        $("#Member-answer-rating-<?php echo $answer->getId() ?> .rate-Member-answer").click(function(){
            $("#Member-answer-rating-<?php echo $answer->getId() ?>").load("/answer/rate/<?php echo $answer->getId() ?>" + "/" + $(this).attr("rating"));
        });
    });
    //]]>
</script>